import re

my_string = """{"appType":3,"checkRegisterSmsFlag": "#smsflag#","mobile": "#mobile#","userName":"#username#",
                "password":"123456",
                "registerOrBind":1,
                "validateType":1}"""

result = re.search('#.+?#', my_string)
print(result)

# 匹配所有
# result = re.finditer('#.+?#', my_string)
# print(result)
# for el in result:
#     print(el)
#     print(el.group(0))  #el.group() 就是匹配的字符
    # print(el.group(1))


##  分组
result = re.finditer('#(.+?)#', my_string)
print(result)
for el in result:
    print(el.group(0))
    print(el.group(1))

